/**
 * weapp-js v1.7.1(2021-4-16)
 * https://codeup.aliyun.com/motigo/motigo/weapp_base
 * Copyright@ 2021 Motigo, Inc.
 * 
 */
// 录音接口封状

import { basicRecorderManager } from "./libs/recordlib/recorder.js";

export default {
    nornalRecorders:{},
    findNormalRecorderById(id){
        /*
            根据id查找recorder
        */
        let recorder = null;
        if(id && typeof id == "string" && this.nornalRecorders[id]){
            recorder = this.nornalRecorders[id]
        }
        return recorder;
    },
    registerNormalRecorderOff(id){
        /*
            组件注销
        */
        if(id && typeof id == "string" && this.nornalRecorders[id]){
            delete this.nornalRecorders[id];
        }
    },
    registerNormalRecorder(id,recorder){
        /*
            注册组件

            参数说明：
                id:录音组件id
                recorder:录音组件实例
        */
        if(id && typeof id == "string"){
            this.nornalRecorders[id] = recorder
        }
    },
    basicRecorderManager:basicRecorderManager,
    getBasicRecorderManager(){
        return new basicRecorderManager()
    }
}